/**
 * Copyright &copy; 2012-2013 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package com.thinkgem.jeesite.common.persistence;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.MappedSuperclass;


/**
 * Entity支持类
 * @author ThinkGem
 * @version 2013-01-15
 */
@MappedSuperclass
public abstract class BaseEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	// 删除标记（0：正常；1：删除）
	public static final String DEL_FLAG_NORMAL = "0";
	public static final String DEL_FLAG_DELETE = "1";

	// 显示/隐藏
	public static final String SHOW = "1";
	public static final String HIDE = "0";
	
	// 是/否
	public static final String YES = "1";
	public static final String NO = "0";

	// 状态状态（0：发布；1：作废；2：审核；）
	public static final String STATUS_RELEASE = "0";
	public static final String STATUS_DELETE = "1";
	public static final String STATUS_AUDIT = "2";
	
	
	public static final Map<String,String> yesNoMap  = new HashMap<String,String>();;
	
	static{
		initYesNoMap();
	}
	
	
	//状态（0：正常; 1:核销  2：作废）
	/**
	 * 已发放
	 */
	public static final String STATUS_NORMAL = "0";
	/**
	 * 已核销， 已消费
	 */
	public static final String STATUS_CLEAR = "1";
	/**
	 * 作废
	 */
	public static final String STATUS_DROP = "2";
	
	
	public static String didplayYesOrNo(String key){
		return (key==null || "0".equals(key)) ?"否" : "是";
	}
	
	public static  Map<String,String> initYesNoMap(){
		yesNoMap.put("是", "1");
		yesNoMap.put("否", "0");
		return yesNoMap;
	}
	
	

}
